<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('终端管理（终端管理的主）列表')" />
    <th:block th:include="include :: layout-latest-css" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="gray-bg">
<div class="ui-layout-west">
    <div class="box box-main">
        <div class="box-header">
            <div class="box-title">
                <i class="fa icon-grid"></i> 安装地址
            </div>
            <div class="box-tools pull-right">
<!--                <a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>-->
                <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
                <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
                <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
            </div>
        </div>
        <div class="ui-layout-content">
            <div id="tree" class="ztree"></div>
        </div>
    </div>
</div>
<div class="ui-layout-center">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <input type="hidden" id="address" name="address">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>终端设备名称：</p>
                                <input type="text" name="tname"/>
                            </li>
                            <li>
                                <p>所属分组ID：</p>
                                <input type="text" name="aid"/>
                            </li>
                            <li>
                                <p>所属用户编号：</p>
                                <input type="text" name="userid"/>
                            </li>
                            <li>
                                <p>出厂编号：</p>
                                <input type="text" name="facid"/>
                            </li>
<!--                            <li>-->
<!--                                <p>安装地址：</p>-->
<!--                                <input type="text" name="address"/>-->
<!--                            </li>-->
                            <li>
                                <p>备注：</p>
                                <input type="text" name="note"/>
                            </li>
                            <li>
                                <p>终端接入通信网：</p>
                                <input type="text" name="comstand"/>
                            </li>
                            <li>
                                <p>终端接入广播电视网模式：</p>
                                <input type="text" name="broadtel"/>
                            </li>
                            <li>
                                <p>终端管理员名称：</p>
                                <input type="text" name="manager"/>
                            </li>
                            <li>
                                <p>终端管理员电话：</p>
                                <input type="text" name="managertel"/>
                            </li>
                            <li>
                                <p>终端交互时间：</p>
                                <input type="text" name="intertime"/>
                            </li>
                            <li class="select-time">
                                <p>创建时间：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreatedtime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreatedtime]"/>
                            </li>
                            <li>
                                <p>终端手机号码：</p>
                                <input type="text" name="phone"/>
                            </li>
                            <li>
                                <p>RDS码：</p>
                                <input type="text" name="rds"/>
                            </li>
                            <li>
                                <p>调频接收频率(终端可收转广播频率 )：</p>
                                <input type="text" name="fmfrequency"/>
                            </li>
                            <li>
                                <p>终端流量使用限制，单位MB：</p>
                                <input type="text" name="trafficlimit"/>
                            </li>
                            <li>
                                <p>1:应急广播终端,2:后备能源型终端,3:发射机型终端：</p>
                                <select name="terminaltype" th:with="type=${@dict.getType('')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li class="select-time">
                                <p>最后访问日期：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginLastaccesstime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endLastaccesstime]"/>
                            </li>
                            <li>
                                <p>现场照片：</p>
                                <input type="text" name="poscene"/>
                            </li>
                            <li>
                                <p>年耗电量：</p>
                                <input type="text" name="ypowerconsumption"/>
                            </li>
                            <li>
                                <p>终端在线状态(显示未交互天数)：</p>
                                <input type="text" name="onlinestate"/>
                            </li>
                            <li>
                                <p>dcs码：</p>
                                <input type="text" name="dcs"/>
                            </li>
                            <li>
                                <p>终端供电模式：</p>
                                <input type="text" name="pdmode"/>
                            </li>
                            <li>
                                <p>充电电流：</p>
                                <input type="text" name="chargecurrent"/>
                            </li>
                            <li>
                                <p>反射功率：</p>
                                <input type="text" name="reflectedpower"/>
                            </li>
                            <li>
                                <p>工作电压：</p>
                                <input type="text" name="workvoltage"/>
                            </li>
                            <li>
                                <p>发射功率：</p>
                                <input type="text" name="transmitpower"/>
                            </li>
                            <li>
                                <p>对讲接收频率：</p>
                                <input type="text" name="irfrequency"/>
                            </li>
                            <li>
                                <p>发射频率：</p>
                                <input type="text" name="transmitfrequency"/>
                            </li>
                            <li>
                                <p>流量使用：</p>
                                <input type="text" name="mflowusing"/>
                            </li>
                            <li>
                                <p>广播接收频率：</p>
                                <input type="text" name="brfrequency"/>
                            </li>
                            <li>
                                <p>终端授权号码：</p>
                                <input type="text" name="atphone"/>
                            </li>
                            <li>
                                <p>终端音量：</p>
                                <input type="text" name="eovolume"/>
                            </li>
                            <li>
                                <p>电池电压：</p>
                                <input type="text" name="batteryvoltage"/>
                            </li>
                            <li>
                                <p>负载电流：</p>
                                <input type="text" name="loadcurrent"/>
                            </li>
                            <li class="select-time">
                                <p>心跳包时间：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginHbtime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endHbtime]"/>
                            </li>
                            <li>
                                <p>维护经费：</p>
                                <input type="text" name="maintenancefunds"/>
                            </li>
                            <li>
                                <p>终端经度：</p>
                                <input type="text" name="latitude"/>
                            </li>
                            <li>
                                <p>终端纬度：</p>
                                <input type="text" name="longitude"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:terminals:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:terminals:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:terminals:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:terminals:import">
                    <i class="fa fa-upload"></i> 导入
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:terminals:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>
    <th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:terminals:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:terminals:remove')}]];
        var prefix = ctx + "system/terminals";
        $(function() {
            var panehHidden = false;
            if ($(this).width() < 769) {
                panehHidden = true;
            }
            $('body').layout({ initClosed: panehHidden, west__size: 185 });
            queryTerminalsList();
            queryDeptTree();
        });
        function queryTerminalsList() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                importUrl: prefix + "/importData",
                importTemplateUrl: prefix + "/importTemplate",
                modalName: "终端管理（终端管理的主）",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'tid', 
                    title : '终端设备IMEI',
                    visible: false
                },
                {
                    field : 'tname', 
                    title : '终端设备名称'
                },
                {
                    field : 'aid', 
                    title : '所属分组ID'
                },
                {
                    field : 'userid', 
                    title : '所属用户编号'
                },
                {
                    field : 'facid', 
                    title : '出厂编号'
                },
                {
                    field : 'address', 
                    title : '安装地址'
                },
                {
                    field : 'note', 
                    title : '备注'
                },
                {
                    field : 'comstand', 
                    title : '终端接入通信网'
                },
                {
                    field : 'broadtel', 
                    title : '终端接入广播电视网模式'
                },
                {
                    field : 'manager', 
                    title : '终端管理员名称'
                },
                {
                    field : 'managertel', 
                    title : '终端管理员电话'
                },
                {
                    field : 'intertime', 
                    title : '终端交互时间'
                },
                {
                    field : 'createdtime', 
                    title : '创建时间'
                },
                {
                    field : 'isuse', 
                    title : '是否可用'
                },
                {
                    field : 'phone', 
                    title : '终端手机号码'
                },
                {
                    field : 'rds', 
                    title : 'RDS码'
                },
                {
                    field : 'fmfrequency', 
                    title : '调频接收频率(终端可收转广播频率 )'
                },
                {
                    field : 'trafficlimit', 
                    title : '终端流量使用限制，单位MB'
                },
                {
                    field : 'terminaltype', 
                    title : '1:应急广播终端,2:后备能源型终端,3:发射机型终端'
                },
                {
                    field : 'lastaccesstime', 
                    title : '最后访问日期'
                },
                {
                    field : 'poscene', 
                    title : '现场照片'
                },
                {
                    field : 'ypowerconsumption', 
                    title : '年耗电量'
                },
                {
                    field : 'onlinestate', 
                    title : '终端在线状态(显示未交互天数)'
                },
                {
                    field : 'dcs', 
                    title : 'dcs码'
                },
                {
                    field : 'pdmode', 
                    title : '终端供电模式'
                },
                {
                    field : 'chargecurrent', 
                    title : '充电电流'
                },
                {
                    field : 'reflectedpower', 
                    title : '反射功率'
                },
                {
                    field : 'workvoltage', 
                    title : '工作电压'
                },
                {
                    field : 'transmitpower', 
                    title : '发射功率'
                },
                {
                    field : 'irfrequency', 
                    title : '对讲接收频率'
                },
                {
                    field : 'transmitfrequency', 
                    title : '发射频率'
                },
                {
                    field : 'mflowusing', 
                    title : '流量使用'
                },
                {
                    field : 'brfrequency', 
                    title : '广播接收频率'
                },
                {
                    field : 'atphone', 
                    title : '终端授权号码'
                },
                {
                    field : 'eovolume', 
                    title : '终端音量'
                },
                {
                    field : 'batteryvoltage', 
                    title : '电池电压'
                },
                {
                    field : 'loadcurrent', 
                    title : '负载电流'
                },
                {
                    field : 'hbtime', 
                    title : '心跳包时间'
                },
                {
                    field : 'maintenancefunds', 
                    title : '维护经费'
                },
                {
                    field : 'latitude', 
                    title : '终端经度'
                },
                {
                    field : 'longitude', 
                    title : '终端纬度'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.tid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.tid + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        }
        function queryDeptTree()
        {
            var url = ctx + "system/terminals/treeData";
            var options = {
                url: url,
                expandLevel: 2,
                onClick : zOnClick
            };
            $.tree.init(options);

            function zOnClick(event, treeId, treeNode) {
                var addr = ""
                for (var i = 0; i <1 ; ) {
                    if (treeNode.id == 0){
                        break
                    }else {
                        addr = treeNode.name+"/"+addr;
                        treeNode = treeNode.getParentNode()
                    }
                }
                addrs = addr.substring(0,addr.length-1)
                $("#address").val(addrs);
                $.table.search();
            }
        }

        $('#btnExpand').click(function() {
            $._tree.expandAll(true);
            $(this).hide();
            $('#btnCollapse').show();
        });

        $('#btnCollapse').click(function() {
            $._tree.expandAll(false);
            $(this).hide();
            $('#btnExpand').show();
        });

        $('#btnRefresh').click(function() {
            queryDeptTree();
        });

        /* 用户管理-部门 */
        function dept() {
            var url = ctx + "system/dept";
            $.modal.openTab("部门管理", url);
        }
    </script>
</body>
<!-- 导入区域 -->
<script id="importTpl" type="text/template">
    <form enctype="multipart/form-data" class="mt20 mb10">
        <div class="col-xs-offset-1">
            <input type="file" id="file" name="file"/>
            <div class="mt10 pt5">
                <input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在，更新这条数据。"> 是否更新已经存在的用户数据
                &nbsp;	<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
            </div>
            <font color="red" class="pull-left mt10">
                提示：仅允许导入“xls”或“xlsx”格式文件！
            </font>
        </div>
    </form>
</script>

</html>